<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="employeeList.title"/></title>
    <meta name="heading" content="<fmt:message key='employeeList.heading'/>"/>
    <meta name="menu" content="RoleAdminPayment"/>
</head>
<div id="help">
    <h2>
        <a href="<c:url value='helpEmployeeList.html?decorate=false'/>"
           title="<fmt:message key="help.pEL"/>"
           onclick="Modalbox.show(this.href, {title: this.title, width: 600}); return false;">
            <fmt:message key="help"/>
        </a>
    </h2>
</div>
<c:set var="buttons">
    <input type="button" style="margin-right: 5px"
           onclick="location.href='<c:url value="/editEmployee.html"/>'"
           value="<fmt:message key="button.add"/>"/>

    <input type="button" onclick="location.href='<c:url value="/mainMenu.html"/>'"
           value="<fmt:message key="button.done"/>"/>
</c:set>

<c:out value="${buttons}" escapeXml="false" />

<s:set name="employees" value="employees" scope="request"/>
<display:table name="employees" class="table" requestURI="" id="employeeList" export="true" pagesize="25">
    <display:column titleKey="edit">
        <a href="<c:url value="/editEmployee.html?id=${employeeList.id}"/>"><img src="<c:url value="/images/edit.png" />" alt="Edit" /></a>
    </display:column>
    <display:column property="lastName" sortable="true" titleKey="employee.lastName" />
    <display:column property="lastName2" sortable="true" titleKey="employee.lastName2" />
    <display:column property="firstName" sortable="true" titleKey="employee.firstName"/>
    <display:column property="task" sortable="true" titleKey="employee.task"/>

    <display:column titleKey="payments.link" style="width:210px" >
        <c:if test="${employeeList.employeeCutter}">
            <a href="<c:url value="/paymentsCuts.html?idEmployee=${employeeList.id}"/>"><fmt:message key="paymentsCutList.link"/></a><br/>
        </c:if>
        <c:if test="${employeeList.employeeDressmaker}">
            <a href="<c:url value="/paymentsPants.html?idEmployee=${employeeList.id}"/>"><fmt:message key="paymentsPantList.link"/></a><br/>
        </c:if>
        <c:if test="${employeeList.employeeFixed}">
            <a href="<c:url value="/paymentsSalaries.html?idEmployee=${employeeList.id}"/>"><fmt:message key="paymentsSalaryList.link"/></a><br/>
        </c:if>
    </display:column>

    <display:column titleKey="asistanceControlList.link" >
        <c:if test="${employeeList.employeeFixed}">
            <a href="<c:url value="/asistancesControl.html?idEmployee=${employeeList.id}"/>"><fmt:message key="asistanceControlList.link"/></a>
        </c:if>
    </display:column>

    <display:setProperty name="paging.banner.item_name" value="employee"/>
    <display:setProperty name="paging.banner.items_name" value="employees"/>

    <display:setProperty name="export.excel.filename" value="Employee List.xls"/>
    <display:setProperty name="export.csv.filename" value="Employee List.csv"/>
    <display:setProperty name="export.pdf.filename" value="Employee List.pdf"/>
</display:table>

<c:out value="${buttons}" escapeXml="false" />

<script type="text/javascript">
    //highlightTableRows("employeeList");
</script>